using System.Collections.Generic;
using OracleInternal.SqlAndPlsqlParser.LocalParsing;

namespace OracleInternal.SqlAndPlsqlParser.RuleProcessors.ODPCommands
{
	internal static class OracleMbEarleySimpleExpressionRuleMultiProcessors
	{
		public static OracleMbEarleyRuleMultiProcessorAddItem[] s_vRuleProcessorItems;

		static OracleMbEarleySimpleExpressionRuleMultiProcessors()
		{
			OracleMbEarleyRuleMultiProcessorAddItem[] array = new OracleMbEarleyRuleMultiProcessorAddItem[16];
			OracleMbEarleyRuleMultiProcessorAddItem oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "simple_expression",
				m_vRHSSymbols = new string[1]
				{
					"'CONNECT_BY_ISCYCLE'"
				},
				m_vRuleProcessor = Process_SimpleExpression_CONNECT_BY_ISCYCLE_Rule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
			};
			array[0] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "simple_expression",
				m_vRHSSymbols = new string[1]
				{
					"'CONNECT_BY_ISLEAF'"
				},
				m_vRuleProcessor = Process_SimpleExpression_CONNECT_BY_ISLEAF_Rule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
			};
			array[1] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "simple_expression",
				m_vRHSSymbols = new string[1]
				{
					"'NULL'"
				},
				m_vRuleProcessor = Process_SimpleExpression_NULL_Rule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
			};
			array[2] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "simple_expression",
				m_vRHSSymbols = new string[1]
				{
					"'ROWID'"
				},
				m_vRuleProcessor = Process_SimpleExpression_ROWID_Rule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
			};
			array[3] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "simple_expression",
				m_vRHSSymbols = new string[3]
				{
					"identifier",
					"'.'",
					"'ROWID'"
				},
				m_vRuleProcessor = Process_SimpleExpression_Identifier_DOT_ROWID_Rule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
			};
			array[4] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "simple_expression",
				m_vRHSSymbols = new string[5]
				{
					"identifier",
					"'.'",
					"identifier",
					"'.'",
					"'ROWID'"
				},
				m_vRuleProcessor = Process_SimpleExpression_Identifier_DOT_Identifier_DOT_ROWID_Rule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
			};
			array[5] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "simple_expression",
				m_vRHSSymbols = new string[1]
				{
					"'ROWNUM'"
				},
				m_vRuleProcessor = Process_SimpleExpression_ROWNUM_Rule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
			};
			array[6] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "simple_expression",
				m_vRHSSymbols = new string[1]
				{
					"col_oj"
				},
				m_vRuleProcessor = Process_SimpleExpression_ColOj_Rule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
			};
			array[7] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "simple_expression",
				m_vRHSSymbols = new string[1]
				{
					"column"
				},
				m_vRuleProcessor = Process_SimpleExpression_Column_Rule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
			};
			array[8] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "simple_expression",
				m_vRHSSymbols = new string[1]
				{
					"literal"
				},
				m_vRuleProcessor = Process_SimpleExpression_Literal_Rule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
			};
			array[9] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "simple_expression",
				m_vRHSSymbols = new string[2]
				{
					"'CONNECT_BY_ROOT'",
					"expr"
				},
				m_vRuleProcessor = Process_SimpleExpression_CONNECT_BY_ROOT_Expr_Rule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
			};
			array[10] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "simple_expression",
				m_vRHSSymbols = new string[3]
				{
					"identifier",
					"'.'",
					"simple_expression"
				},
				m_vRuleProcessor = Process_SimpleExpression_Identifier_DOT_SimpleExpression_Rule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
			};
			array[11] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "simple_expression",
				m_vRHSSymbols = new string[5]
				{
					"identifier",
					"'.'",
					"identifier",
					"'.'",
					"simple_expression"
				},
				m_vRuleProcessor = Process_SimpleExpression_Identifier_DOT_Identifier_DOT_SimpleExpression_Rule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
			};
			array[12] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "simple_expression",
				m_vRHSSymbols = new string[1]
				{
					"'CURRVAL'"
				},
				m_vRuleProcessor = Process_SimpleExpression_CURRVAL_Rule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
			};
			array[13] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "simple_expression",
				m_vRHSSymbols = new string[1]
				{
					"'NEXTVAL'"
				},
				m_vRuleProcessor = Process_SimpleExpression_NEXTVAL_Rule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
			};
			array[14] = oracleMbEarleyRuleMultiProcessorAddItem;
			oracleMbEarleyRuleMultiProcessorAddItem = new OracleMbEarleyRuleMultiProcessorAddItem
			{
				m_vHeadSymbol = "col_oj",
				m_vRHSSymbols = new string[4]
				{
					"column",
					"'('",
					"'+'",
					"')'"
				},
				m_vRuleProcessor = Process_ColOj_Column_LEFT_PARENTHESIS_PLUS_RIGHT_PARENTHESIS_Rule,
				m_vAddType = OracleMbEarleyRuleMultiProcessorAddType.SpecificRule
			};
			array[15] = oracleMbEarleyRuleMultiProcessorAddItem;
			s_vRuleProcessorItems = array;
		}

		public static object Process_SimpleExpression_CONNECT_BY_ISCYCLE_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			return new OracleLpPseudoColumnExpression(null)
			{
				PseudoColumnExpressionType = OracleLpPseudoColumnExpressionType.CONNECT_BY_ISCYCLE
			};
		}

		public static object Process_SimpleExpression_CONNECT_BY_ISLEAF_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			return new OracleLpPseudoColumnExpression(null)
			{
				PseudoColumnExpressionType = OracleLpPseudoColumnExpressionType.CONNECT_BY_ISLEAF
			};
		}

		public static object Process_SimpleExpression_NULL_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			return new OracleLpSimpleExpression(null)
			{
				SimpleExpressionType = OracleLpSimpleExpressionType.NULL
			};
		}

		public static object Process_SimpleExpression_ROWID_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			return new OracleLpPseudoColumnExpression(null)
			{
				PseudoColumnExpressionType = OracleLpPseudoColumnExpressionType.ROWID
			};
		}

		public static object Process_SimpleExpression_Identifier_DOT_ROWID_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			OracleLpPseudoColumnExpression obj = new OracleLpPseudoColumnExpression(null)
			{
				PseudoColumnExpressionType = OracleLpPseudoColumnExpressionType.ROWID
			};
			List<ParseNode> list = ctx.CurrentParseNode.Children();
			obj.ParentObjectName = new OracleLpName(ctx.Tokens[list[0].From].m_vContent);
			return obj;
		}

		public static object Process_SimpleExpression_Identifier_DOT_Identifier_DOT_ROWID_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			OracleLpPseudoColumnExpression obj = new OracleLpPseudoColumnExpression(null)
			{
				PseudoColumnExpressionType = OracleLpPseudoColumnExpressionType.ROWID
			};
			List<ParseNode> list = ctx.CurrentParseNode.Children();
			obj.SchemaName = new OracleLpName(ctx.Tokens[list[0].From].m_vContent);
			obj.ParentObjectName = new OracleLpName(ctx.Tokens[list[2].From].m_vContent);
			return obj;
		}

		public static object Process_SimpleExpression_ROWNUM_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			return new OracleLpPseudoColumnExpression(null)
			{
				PseudoColumnExpressionType = OracleLpPseudoColumnExpressionType.ROWNUM
			};
		}

		public static object Process_SimpleExpression_ColOj_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			return new OracleLpColumnExpression(null)
			{
				Plus = true,
				Column = (OracleMbEarleyRuleMultiProcessor.ProcessNodeRules(ctx.CurrentParseNode, ctx.CurrentRuleIndex + 1, -1, ctx) as OracleLpColumn)
			};
		}

		public static object Process_SimpleExpression_Column_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			OracleLpColumnExpression oracleLpColumnExpression = new OracleLpColumnExpression(null);
			OracleMbEarleyRuleMultiProcessorTable ruleProcessorTable = ctx.RuleProcessorTable;
			ctx.RuleProcessorTable = ctx.GetRuleProcessorTable("column");
			oracleLpColumnExpression.Column = OracleMbEarleyRuleMultiProcessor.ProcessNodeRules(ctx.CurrentParseNode, ctx.CurrentRuleIndex + 1, -1, ctx) as OracleLpColumn;
			ctx.RuleProcessorTable = ruleProcessorTable;
			return oracleLpColumnExpression;
		}

		public static object Process_SimpleExpression_Literal_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			OracleLpConstantExpression oracleLpConstantExpression = new OracleLpConstantExpression(null);
			OracleMbEarleyRuleMultiProcessorTable ruleProcessorTable = ctx.RuleProcessorTable;
			ctx.RuleProcessorTable = ctx.GetRuleProcessorTable("literal");
			object expressionValue = OracleMbEarleyRuleMultiProcessor.ProcessNodeRules(ctx.CurrentParseNode, 0, -1, ctx);
			ctx.RuleProcessorTable = ruleProcessorTable;
			oracleLpConstantExpression.ExpressionValue = expressionValue;
			return oracleLpConstantExpression;
		}

		public static object Process_SimpleExpression_CONNECT_BY_ROOT_Expr_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			OracleLpPseudoColumnExpression obj = new OracleLpPseudoColumnExpression(null)
			{
				PseudoColumnExpressionType = OracleLpPseudoColumnExpressionType.CONNECT_BY_ROOT
			};
			List<ParseNode> list = ctx.CurrentParseNode.Children();
			obj.Expression = (OracleLpExpression)OracleMbEarleyRuleMultiProcessor.ProcessNodeRules(list[1], 0, -1, ctx);
			return obj;
		}

		public static object Process_SimpleExpression_Identifier_DOT_SimpleExpression_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			OracleLpSequenceExpression oracleLpSequenceExpression = new OracleLpSequenceExpression(null);
			List<ParseNode> list = ctx.CurrentParseNode.Children();
			oracleLpSequenceExpression.SequenceName = ctx.Tokens[list[0].From].m_vContent;
			oracleLpSequenceExpression.SequenceExpressionType = (OracleLpSequenceExpressionType)OracleMbEarleyRuleMultiProcessor.ProcessNodeRules(list[2], 0, -1, ctx);
			return oracleLpSequenceExpression;
		}

		public static object Process_SimpleExpression_Identifier_DOT_Identifier_DOT_SimpleExpression_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			OracleLpSequenceExpression oracleLpSequenceExpression = new OracleLpSequenceExpression(null);
			List<ParseNode> list = ctx.CurrentParseNode.Children();
			oracleLpSequenceExpression.SchemaName = ctx.Tokens[list[0].From].m_vContent;
			oracleLpSequenceExpression.SequenceName = ctx.Tokens[list[2].From].m_vContent;
			oracleLpSequenceExpression.SequenceExpressionType = (OracleLpSequenceExpressionType)OracleMbEarleyRuleMultiProcessor.ProcessNodeRules(list[4], 0, -1, ctx);
			return oracleLpSequenceExpression;
		}

		public static object Process_SimpleExpression_CURRVAL_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			return OracleLpSequenceExpressionType.CURRVAL;
		}

		public static object Process_SimpleExpression_NEXTVAL_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			return OracleLpSequenceExpressionType.NEXTVAL;
		}

		public static object Process_ColOj_Column_LEFT_PARENTHESIS_PLUS_RIGHT_PARENTHESIS_Rule(OracleMbEarleyParserMultiContext ctx, int ruleMatchPosition)
		{
			OracleMbEarleyRuleMultiProcessorTable ruleProcessorTable = ctx.RuleProcessorTable;
			ctx.RuleProcessorTable = ctx.GetRuleProcessorTable("column");
			object result = OracleMbEarleyRuleMultiProcessor.ProcessNodeRules(ctx.CurrentParseNode, ctx.CurrentRuleIndex + 1, -1, ctx);
			ctx.RuleProcessorTable = ruleProcessorTable;
			return result;
		}
	}
}
